home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_11_05 / test_obj / readme.txt < prev    next >
Text File  |  1993-02-28  |  5KB  |  108 lines

  1. File: README.TXT
  2. Copyright Norman Wilde 1993
  3. /***********************************************************************/
  4. /* The code and documentation for the "little language" based testing  */
  5. /* system is provided free. You are welcome to duplicate it and        */
  6. /* modify it. (However the AnaGram programming system it uses is a     */
  7. /* commercial product, available from Jerome T. Holland, 22 Forty      */
  8. /* Acres Drive, Wayland, MA 01778, tel. 508-358-7968.)                 */
  9. /*                                                                     */
  10. /* If you have any suggestions about the testing system, please let    */
  11. /* me know.                                                            */
  12. /*                                                                     */
  13. /* The system is provided as-is and with no warranty of fitness for use*/
  14. /* for any particular purpose or situation. I disclaim all             */
  15. /* responsibility for any damages arising out of the use of this system*/
  16. /* or any of its components.                                           */
  17. /*                                       Norman Wilde                  */
  18. /*                                       wilde@cs.uwf.edu              */
  19. /***********************************************************************/
  20.  
  21. INTRODUCTION:
  22.  
  23. This readme file describes the content and the use
  24. of a testing system for objects and other c/c++ code
  25. based on a "little language". The objective of the system
  26. is to let a programmer generate test driver programs that
  27. will thoroughly test an object class or a collection of
  28. c functions.
  29.  
  30. The overall structure
  31. of the system is as shown in the following diagram:
  32.  
  33.        Driver Generator Language
  34.         syntax file(DGEN.SYN)    -> AnaGram
  35.                                        |
  36.                                        V
  37.              Test spec     -> Driver generator  -> Test Driver
  38.             (Tnnn.TST)          (DGEN.EXE)          (Tnnn.CPP)
  39.  
  40. You can use the existing system immediately to build test drivers that
  41. only use basic c data types such as strings, ints, etc. If you need to
  42. make a driver that handles your specialized objects you need to
  43. extend the syntax file (DGEN.SYN) and you will need the
  44. AnaGram grammar based programming system.
  45.  
  46. USING THE EXISTING SYSTEM:
  47.  
  48. The current version of DGEN.SYN produces the driver generator
  49. DGEN.EXE. This can handle test specification files containing
  50. the following c data types:
  51.                   char
  52.                   string  (ie. char * with nul termination)
  53.                   int
  54.                   double
  55.                   FILE *
  56. as well as for the object classes in the Invoice example:
  57.                   Item
  58.                   Client
  59.                   Invoice
  60.  
  61. To perform a set of tests, the steps are:
  62.   1. Write a Test Specification File similar to T001.TST, which
  63.   tests the objects in INVOICE.H and INVOICE.CPP. DGEN.SYN can be
  64.   consulted for details of the little language for test specifications.
  65.   2. Generate a test driver, say T001.CPP, using the following
  66.   command:
  67.         DGEN <T001.TST >T001.CPP
  68.   3. Compile the resulting test driver and link it with the
  69.   objects to be tested. The command will probably be something
  70.   like:
  71.         TCC T001.CPP INVOICE.CPP TESTGEN.CPP
  72.   This should produce an executable called T001.EXE. Note that
  73.   the TESTGEN.CPP file is needed since it contains utilities that
  74.   help to generate combinations of data for testing.
  75.   4. Run the test with a command such as:
  76.         T001 > T001.OUT
  77.   5. Check the test output in T001.OUT by hand or by comparison
  78.   with previous output from the same test.
  79.  
  80. ADDING YOUR OWN OBJECT CLASSES:
  81.  
  82. To extend the little language for a new object class, just
  83. add another alternative to the "declaration" production in
  84. DGEN.SYN. The existing "ClientDeclaration" or "InvoiceDeclaration"
  85. could serve as a model.
  86.  
  87. Use AnaGram to process the changed DGEN.SYN and produce a new DGEN.C
  88. and DGEN.H. Then compile with a command similar to the following:
  89.     TCC DGEN.C TUTILS.C
  90. to produce a new DGEN.EXE and proceed as in the previous section. Note
  91. that TUTILS.C is needed since it contains the code of the reduction
  92. procedures.
  93.  
  94. FILES IN THE SYSTEM:
  95. DGEN     SYN     Syntax of the Driver Generator Language
  96. DGEN     C       Source for driver generator - produced by AnaGram
  97. DGEN     H       Header for DGEN.C - produced by AnaGram
  98. DGEN     EXE     Executable for driver generator
  99. INVOICE  CPP     Code for the Invoice example
  100. INVOICE  H       Header for the Invoice example
  101. README   TXT     This file
  102. T001     CPP     Test driver generated from spec. T001.TST
  103. T001     TST     Test specification for the Invoice example
  104. TESTGEN  CPP     Utility code used by generated test drivers.
  105. TESTGEN  H       Header for TESTGEN.CPP
  106. TUTILS   C       Utility code used in generating test drivers.
  107. TUTILS   H       Header for TUTILS.C
  108.